]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Bug 588405 - Handle status menu button appearance in JavaScript
authorSander Dijkhuis <sander.dijkhuis@gmail.com>
Sun, 12 Jul 2009 21:44:06 +0000 (23:44 +0200)
committerSander Dijkhuis <sander.dijkhuis@gmail.com>
Mon, 13 Jul 2009 11:54:38 +0000 (13:54 +0200)
Make the ClutterText and ClutterTexture from the status menu
button available to JavaScript, and from there improve the
font definition of the user name.

shell-status-menu.[ch]: Add public get_name() and get_icon()
    functions that return the user name label and icon
    texture, remove the markup from update_name_text().
panel.js: Set the font for the button consistently with that
    of the other panel labels.

js/ui/panel.js
src/shell-status-menu.c
src/shell-status-menu.h

index 24ac5d240ee9b7066e2d777b41b41d3d4dd27ca0..a7f6827692282bbedd9e9d33d667223e8ae9fb86 100644 (file)
@@ -93,6 +93,7 @@ Panel.prototype = {
 
         let statusbox = new Big.Box();
         let statusmenu = this._statusmenu = new Shell.StatusMenu();
+        statusmenu.get_name().fontName = 'Sans Bold 16px';
         statusbox.append(this._statusmenu, Big.BoxPackFlags.NONE);
         let statusbutton = new Button.Button(statusbox, PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
                                              true, null, PANEL_HEIGHT);
index fa0be00b95208b419963c91bf4ecdbc9830082c1..4507d6a78304022174e4ab47c9676967c4b45370 100644 (file)
@@ -117,12 +117,9 @@ static void
 update_name_text (ShellStatusMenu *status)
 {
   ShellStatusMenuPrivate *priv = status->priv;
-  char      *markup;
 
-  markup = g_markup_printf_escaped("<b>%s</b>",
-                                   gdm_user_get_real_name (GDM_USER (priv->user)));
-  clutter_text_set_markup (priv->name, markup);
-  g_free (markup);
+  clutter_text_set_text (priv->name,
+                         gdm_user_get_real_name (GDM_USER (priv->user)));
 }
 
 static void
@@ -655,3 +652,27 @@ shell_status_menu_toggle (ShellStatusMenu *status, ClutterEvent *event)
           status, 1, event->button.time);
     }
 }
+
+/**
+ * shell_status_menu_get_name:
+ * @menu: a #ShellStatusMenu
+ *
+ * Return value: (transfer none): the #ClutterText actor with the user's name.
+ */
+ClutterText *
+shell_status_menu_get_name (ShellStatusMenu *menu)
+{
+  return menu->priv->name;
+}
+
+/**
+ * shell_status_menu_get_icon:
+ * @menu: a #ShellStatusMenu
+ *
+ * Return value: (transfer none): the #ClutterTexture actor with the user icon.
+ */
+ClutterTexture *
+shell_status_menu_get_icon (ShellStatusMenu *menu)
+{
+  return menu->priv->user_icon;
+}
index d31dca67bf39d217f58cfac3d4233d6513434d0e..983174187027e7d758ad35270e7ae000daa10e02 100644 (file)
@@ -37,6 +37,9 @@ GType             shell_status_menu_get_type     (void);
 
 void              shell_status_menu_toggle       (ShellStatusMenu *menu, ClutterEvent *event);
 
+ClutterText      *shell_status_menu_get_name     (ShellStatusMenu *menu);
+ClutterTexture   *shell_status_menu_get_icon     (ShellStatusMenu *menu);
+
 G_END_DECLS
 
 #endif /* __SHELL_STATUS_MENU_H__ */